﻿namespace DimensionsHelper.ExcelAddIn.Core.Sql;

/// <summary>
/// SQL 设置的表格设置
/// </summary>
public class DataTableSettingsTransmission
{
    /// <summary>
    /// 保留的小数位数
    /// </summary>
    public int DecimalPlaces { get; set; }

    /// <summary>
    /// 是否添加百分比
    /// </summary>
    public bool AddPercentage { get; set; }

    /// <summary>
    /// 数据表页名称
    /// </summary>
    public string ResultPageName { get; set; } = string.Empty;


    public DataTableSettings ToSettings()
    {
        return new DataTableSettings
        {
            DecimalPlaces = DecimalPlaces,
            AddPercentage = AddPercentage,
            ResultPageName = ResultPageName
        };
    }


    public void ToSettings(DataTableSettings settings)
    {
        settings.DecimalPlaces = DecimalPlaces;
        settings.AddPercentage = AddPercentage;
        settings.ResultPageName = ResultPageName;
    }
}
